UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNDELssgSF8rHx4EJiZEkHagnUdwZMjA7OLXhKVn+ec='
WHERE
key_id = '67d475dbdb51df231e0a10cb945062b16de56fc12c23b23fe0d7d5c2d16ee0c9'
AND (
token = 'tNDELssgSF8rHx4EJiZEkHagnUdwZMjA7OLXhKVn+ec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)