UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rN4v6WBL4HxMsUtHNUC+g+2YLz+2Tk6/X4IW0+cOH4='
WHERE
key_id = 'e3173dc0e9cd63ad806f82533355adb78c15408cb5cbe65b82fe99c67fb95f63'
AND (
token = '9rN4v6WBL4HxMsUtHNUC+g+2YLz+2Tk6/X4IW0+cOH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)