UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vvqh6NxdjrVmW80uItwgE6k7yiKcXrRdqCvug8jQDXQ='
WHERE
key_id = '5362dc1c26f45200d973ee4ecc21a59782001a4e881852921192b39259739fe2'
AND (
token = 'Vvqh6NxdjrVmW80uItwgE6k7yiKcXrRdqCvug8jQDXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)