UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Icu5Hy9xs52JI1vOfQKniiTD8ojRuzyzHjR6V06XHO0='
WHERE
key_id = '75c39b7721c5a613bfc8c67791616c80ff3cff6b1b0b628eabd782be343c7884'
AND (
token = 'Icu5Hy9xs52JI1vOfQKniiTD8ojRuzyzHjR6V06XHO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)