UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SuLd024dvwVVZXQZsiCUgvQR3/S7cGDj3xGld0tUOvk=' 
WHERE 
  key_id = 'f92746d0c6e95e4755d47c1138a3791e1052f4b27f1f4ce0a8773ac27461d718' 
  AND (
    token = 'SuLd024dvwVVZXQZsiCUgvQR3/S7cGDj3xGld0tUOvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044