UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bWGpFv0ffDAS9z4jhWcWskDDFaELOx86x1u3i2qipfQ=' 
WHERE 
  key_id = '480350896ec318b47c8b6f618a87e2737cc1c64068dcc6a0f1acf85754f54315' 
  AND (
    token = 'bWGpFv0ffDAS9z4jhWcWskDDFaELOx86x1u3i2qipfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034