UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2tAEXzybh6M3EaqfhgWCw8ywMopXwoMdVpC3ulVHjbY=' 
WHERE 
  key_id = '9915c4cad94dc56be505fe87e4c93f2b8b98ebefef51a248dac8a583b4fe7a75' 
  AND (
    token = '2tAEXzybh6M3EaqfhgWCw8ywMopXwoMdVpC3ulVHjbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043