UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T14NXgDcFMcK2od1DkygKSUWENguBQTE8Kxq0ba7EwI=' 
WHERE 
  key_id = 'e4a3e7ab3f5cf963eccdb83d2a3a514036aa845e83ac4c1ba36cc9e3efa8c0c6' 
  AND (
    token = 'T14NXgDcFMcK2od1DkygKSUWENguBQTE8Kxq0ba7EwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025