UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJJAm9TMwxEWE4z/C1M9D96k0+K9PB0CudvxJGrDavI='
WHERE
key_id = '4da44974d656d189368dac8733666080a2051f41d3720f96cd10c1bf2a098f4d'
AND (
token = 'ZJJAm9TMwxEWE4z/C1M9D96k0+K9PB0CudvxJGrDavI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)