UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YZNAcQr//NKcbgOriVKvUSXPITJUYLyTrvCuqduwqSU='
WHERE
key_id = '18b5031632db2c550230da40fb3c3b94f9962689e403ba6046191b1b92541c48'
AND (
token = 'YZNAcQr//NKcbgOriVKvUSXPITJUYLyTrvCuqduwqSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)