UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VkqDhrlGnc9L9vB/wkB+7nz2ivrESMMjZiUttNXTsKI='
WHERE
key_id = '448978133200a96d2ad642fad34a3e1b28680270f1c0e84e895d1360625cf2c5'
AND (
token = 'VkqDhrlGnc9L9vB/wkB+7nz2ivrESMMjZiUttNXTsKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)