UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gwLwrMfTpdEVwolq69+ooOreQsGKcmWpR7jQAztGdeg='
WHERE
key_id = '7e4bb9c45e9152bd018aadb1ce0ef025890949c542d03053cfde698d284a97f2'
AND (
token = 'gwLwrMfTpdEVwolq69+ooOreQsGKcmWpR7jQAztGdeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)