UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DDkVaabcraTD0A04wwcbQkwdISLnydMc1S9+eF5lAUA='
WHERE
key_id = '7f48861daf21fc400089e231ff1ad82e61867659dff44abc5f14e5cd4a9bc92c'
AND (
token = 'DDkVaabcraTD0A04wwcbQkwdISLnydMc1S9+eF5lAUA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)