UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xY8Q8OA1Q3xgV8lDmOvlBhHoZUQI6+FcPFJwT8lfzGM=' 
WHERE 
  key_id = '7cd36ebb6a85753798350b91830724faac2ed82db4a25015e043cffa4ac98673' 
  AND (
    token = 'xY8Q8OA1Q3xgV8lDmOvlBhHoZUQI6+FcPFJwT8lfzGM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018