UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '20k+InTc+JHPOMxtYFxLY9n9Khy479bZGK0oQQ5tvb0='
WHERE
key_id = '96b577be1a70f6b81083498739c416a919017f3f984e5bda92b5ba61a0a8a012'
AND (
token = '20k+InTc+JHPOMxtYFxLY9n9Khy479bZGK0oQQ5tvb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)