UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZtKE2OgtZR0QjNNkXVf3erWIxe9rnoZFVo4lXwigBy0='
WHERE
key_id = '176169f657c1681795b2516685e6671ddd72e939329ea5c2264708e2a4aa62d1'
AND (
token = 'ZtKE2OgtZR0QjNNkXVf3erWIxe9rnoZFVo4lXwigBy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)