UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DugTYIW4HmGPPgGOotR34i1ZLupLVNDLDaej4I2iMm4='
WHERE
key_id = '0c8a01750c28ea98f6bfe1c6d9763d75f8f56a0319722acc2c9467d6906aaf9b'
AND (
token = 'DugTYIW4HmGPPgGOotR34i1ZLupLVNDLDaej4I2iMm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)