UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yf3SNWUqXtabpgSf89jakKOPuLC/SYw/KoVUYEpgMbg=' 
WHERE 
  key_id = '5e2e35c3df09c51cfa809e3e039c2f108fa4e8048a5b630ddce5c6c82743743b' 
  AND (
    token = 'Yf3SNWUqXtabpgSf89jakKOPuLC/SYw/KoVUYEpgMbg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050