UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MKWWsYDBjoGoIbezU4Ol0+PItcBCtwwLFWqAh7Ip/yE=' 
WHERE 
  key_id = '59dfe5fc779db3f2dbf9b89ca82fba9c51b7caea5468683c2cb39e63734e85fd' 
  AND (
    token = 'MKWWsYDBjoGoIbezU4Ol0+PItcBCtwwLFWqAh7Ip/yE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019