UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MAQ9+ZYmfTAlc5TaTnxietszjBjbIOeutD5Asd7udUQ='
WHERE
key_id = '00f13bc66c4fcd481309c9205722136a59b1efbf4ca71802db5b30150e7b9393'
AND (
token = 'MAQ9+ZYmfTAlc5TaTnxietszjBjbIOeutD5Asd7udUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)