UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Y0JMfTyLgmjA3KkPfb4WJ1+rvM4QZOMNFrl93gTj+o=' 
WHERE 
  key_id = '95c80562ac065c1e720191908af553bb1f8b07c81f6362195bcb9f12e927da14' 
  AND (
    token = '1Y0JMfTyLgmjA3KkPfb4WJ1+rvM4QZOMNFrl93gTj+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032