UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uhjeUuOBK6W6cNZWrU+2R+omM6K54ThsnYnu53r55r4=' 
WHERE 
  key_id = '2d4c9a1a49e2fbe6bd7a67135c8b911d93f8d9fbc4ca6a1726e931a7e854b36e' 
  AND (
    token = 'uhjeUuOBK6W6cNZWrU+2R+omM6K54ThsnYnu53r55r4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032