UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xoH45H6rQfZyPNrgHru5+/Ym+aqbncd+kx8pbXslcxE='
WHERE
key_id = '688862ae5becf148819f6b9c5759a1d3ecb620f23e75efbbc79ed50ee327763e'
AND (
token = 'xoH45H6rQfZyPNrgHru5+/Ym+aqbncd+kx8pbXslcxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)