UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Fu3r6h0IQ2bVZAL0HNZChxqcsYl0tvm8sYgU56Of5Y=' 
WHERE 
  key_id = '8a3e3414dbfbf9de9f089af4922283b8de1e0880f3b0b3c44adb2f695c6fb5d6' 
  AND (
    token = '9Fu3r6h0IQ2bVZAL0HNZChxqcsYl0tvm8sYgU56Of5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064