UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BfX1HvcDwHrjxvsMV8+di41xCDNU0wVGxY8lS90SFU4='
WHERE
key_id = '96becee8cac272b9acf86026ffb34378f07eea67d28ac2a0a926ea2481a0f56b'
AND (
token = 'BfX1HvcDwHrjxvsMV8+di41xCDNU0wVGxY8lS90SFU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)