UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vv9LUMG3talAY8BdnWK5fHNimpLHSiYXeh25OcaV5k8='
WHERE
key_id = '65408132adafc3537f77b5a6fbe78ef2ed8f5bee305d05c5b2d8fd1ab6e176bf'
AND (
token = 'Vv9LUMG3talAY8BdnWK5fHNimpLHSiYXeh25OcaV5k8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)