UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ce5ZzKvmCRaEQSkLeP9bfJxWhwKnLM1/dXaqTYoSG6E=' 
WHERE 
  key_id = '0a8519a658a78f8d4837a4d65e36ec9dce47a2c17d6d847cb0bf37e47ec0b63b' 
  AND (
    token = 'ce5ZzKvmCRaEQSkLeP9bfJxWhwKnLM1/dXaqTYoSG6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040