UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FGtLBKyUi2GTPw4ml6GGpnsCrX6iz5TKGxP/QICdJSY='
WHERE
key_id = 'd88d740c66255f68a2bef020ec31c74221e9520bcaea1eca84b468dfed5bcd02'
AND (
token = 'FGtLBKyUi2GTPw4ml6GGpnsCrX6iz5TKGxP/QICdJSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)