UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '95c9DmBPqJLU9TF/+8WpR711N/yHkF6xS1RUbzMq76w=' 
WHERE 
  key_id = '18479ef03e648e8183100af0b245f49d70ae363aed03b0a087de476f7fb1d0de' 
  AND (
    token = '95c9DmBPqJLU9TF/+8WpR711N/yHkF6xS1RUbzMq76w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020