UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ElwiI853pb6rHNJqoeu1qxi0E47teat6/IHg6XcIXAg=' 
WHERE 
  key_id = 'ce16c89e3f54b778d7344eeb2c9da8a390bf3a092bac62ea0493c00415762cc0' 
  AND (
    token = 'ElwiI853pb6rHNJqoeu1qxi0E47teat6/IHg6XcIXAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035