UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NDPrv7SGmp+wGGzkfsqjhlFOhkJ065F7bILfqpNFexo=' 
WHERE 
  key_id = 'fa1ba7cb60a6b42b8e5064f04a0e47f3c9a49cec0c65154ae142aa929c2e6f43' 
  AND (
    token = 'NDPrv7SGmp+wGGzkfsqjhlFOhkJ065F7bILfqpNFexo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028