UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PWJ7HfbivgpSSuFW6bC9NjG6/M7wCjFa4xBDWtnEw9o=' 
WHERE 
  key_id = '0d9fb91325088e129c1dd50f637b28482c8b9e214b10ae1fe9617a339fa8b9ba' 
  AND (
    token = 'PWJ7HfbivgpSSuFW6bC9NjG6/M7wCjFa4xBDWtnEw9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034