UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+BSJGmb7yQPqJdU2s5omhdoT8F/d7lSja/KwHMoOQNg=' 
WHERE 
  key_id = 'f390e0cb90d320f4b16644ee4b4d510ae505731379f1b1128b81c48b4ea94efc' 
  AND (
    token = '+BSJGmb7yQPqJdU2s5omhdoT8F/d7lSja/KwHMoOQNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051