UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W+rBWAyY8IOljq0YqWKLRgnQEokZjxW+TyOeuOHI/14=' 
WHERE 
  key_id = '5eb8ef6e14ce810b78d592d656e255d2135af7c952374e7340ecbd88f8bfe503' 
  AND (
    token = 'W+rBWAyY8IOljq0YqWKLRgnQEokZjxW+TyOeuOHI/14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039