UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G8+WP8+Q229xSvbWJWIdjOafTehdURJG1mrjJSFX3oU='
WHERE
key_id = '752e2ff15d313d870953ed24cc214e5eacfdd5b60777df01a71a7fc55ff76c5b'
AND (
token = 'G8+WP8+Q229xSvbWJWIdjOafTehdURJG1mrjJSFX3oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)