UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+8e/yQdWh91mqjRWyT0FxsFVPZ51GYd03e+B9IXINFM=' 
WHERE 
  key_id = '688b7fe01d23fe3c6bb469932866c448e95ff9d0538ef166e0b6559329c9b044' 
  AND (
    token = '+8e/yQdWh91mqjRWyT0FxsFVPZ51GYd03e+B9IXINFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041