UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0oqt515L7lQYqvhdeX2XGxoL2Wloo93jiR2sVh1bvPQ=' 
WHERE 
  key_id = 'a52cc1e1bf3a77dbb8d408ffba2a08b31aed4773e9afca05cc080571eaba408e' 
  AND (
    token = '0oqt515L7lQYqvhdeX2XGxoL2Wloo93jiR2sVh1bvPQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045