UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mWqj7FAveZ3zEuSAwGvYlR99mLDYw/szCc8zcOryOuQ='
WHERE
key_id = 'd46449685ae1ff7a2aa6b85f9153e769c27541dedc6b24c4ecf5cefddb73d347'
AND (
token = 'mWqj7FAveZ3zEuSAwGvYlR99mLDYw/szCc8zcOryOuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)