UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/cI+U7blvMFnLYOdGS6PAuU4Z14rW8NvoKuXp1A316A=' 
WHERE 
  key_id = '84fab84375c8bddd9e80e840ec736d8018893ecb1e298e058f05ff51ee2822fa' 
  AND (
    token = '/cI+U7blvMFnLYOdGS6PAuU4Z14rW8NvoKuXp1A316A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036