UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ZlnArs02+wKvUssMyd4zMvAL62QwheXAHU3rToJvlA=' 
WHERE 
  key_id = '2eadb6aa356961f0dba17a72d1d0f8fe6823faf1cd122d34cde8663c6a92dd4b' 
  AND (
    token = '4ZlnArs02+wKvUssMyd4zMvAL62QwheXAHU3rToJvlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030