UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9OVdcmZWKphnZF/5VR/qcW1TgRvVT/STTkUq4UHHeR0='
WHERE
key_id = 'ac508fbc855a6e8b565668f68c9812967be2c29ebe94e5acae0903d2d5b0c082'
AND (
token = '9OVdcmZWKphnZF/5VR/qcW1TgRvVT/STTkUq4UHHeR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)