UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7uxCdoaxLq5TwbpOYmV5gHbhcmwc6TQwiiLFfy/HzA='
WHERE
key_id = 'bdda93e4c4bb25d2af15a5fa09678220b9e1271ca9183e34cb75da99364dc5a7'
AND (
token = '/7uxCdoaxLq5TwbpOYmV5gHbhcmwc6TQwiiLFfy/HzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)