UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KQKo0ksdjggf+hWW/xWoK0M23rAkYD1GyzRFAm4bz50='
WHERE
key_id = '0b608767d86d8cf7718fd12674634944ec696edb1546324fcc1af145105e4d35'
AND (
token = 'KQKo0ksdjggf+hWW/xWoK0M23rAkYD1GyzRFAm4bz50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)