UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rEUzOcHNI5rYO7iqZ3XKvoOV85KGh5HoZe3UoYFYKsg=' 
WHERE 
  key_id = '81c9ac9e35780f7326e41ff403e18e1f668c44dd3d7a27104265afd53f945ff8' 
  AND (
    token = 'rEUzOcHNI5rYO7iqZ3XKvoOV85KGh5HoZe3UoYFYKsg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038