UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8OFw8g/WDSsTZqFfq8wXoE3tBB+eU9jn5SBNZedgO9w=' 
WHERE 
  key_id = 'f6cd1d7d811b5b4558c3bb554e6eaa466b2df2f549239bc39dba23c0bfb7c8e6' 
  AND (
    token = '8OFw8g/WDSsTZqFfq8wXoE3tBB+eU9jn5SBNZedgO9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023