UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E6zMqxz7//xvrSG92UePUnHp5jdWHBQYyKo6FV3PA74='
WHERE
key_id = '22871d6f8bef812a10e302b9d0defd5ddb6010bcfedc1cbda958a846e61dbe61'
AND (
token = 'E6zMqxz7//xvrSG92UePUnHp5jdWHBQYyKo6FV3PA74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)