UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'djBSsAeiGJ5lgUEaVum5eXhjoBsGzCo4MjLhgs2Hngo=' 
WHERE 
  key_id = 'a68a003682fc74e114cc59d6eebceeeb23a71456a5a5b01b2562b7680209fa4d' 
  AND (
    token = 'djBSsAeiGJ5lgUEaVum5eXhjoBsGzCo4MjLhgs2Hngo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016