UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T1xEwsGPvc7LG+2XcRol9pH69Hgx5GZAMLTtheHVz8U=' 
WHERE 
  key_id = 'cec41f23d66a0803c904ab1d5315f8fe4aba877974d09707b7fa0426d2634c73' 
  AND (
    token = 'T1xEwsGPvc7LG+2XcRol9pH69Hgx5GZAMLTtheHVz8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036