UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BIbRdbL0k0kglKiCHVpHQH7BR+hnhgco+OJRHlBhPzE='
WHERE
key_id = '5ec3342900b43351de775726738310835f332e806330e9dec6299132353fe6eb'
AND (
token = 'BIbRdbL0k0kglKiCHVpHQH7BR+hnhgco+OJRHlBhPzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)