UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43MI4AJ8Y2bFGk7Z8UeDkxDg+cKfRk/PhqNon5kATo0='
WHERE
key_id = 'dae8ef1d9df93bde38729a2da2f594a364bb5f331a925acba28eb3408b3d5ef8'
AND (
token = '43MI4AJ8Y2bFGk7Z8UeDkxDg+cKfRk/PhqNon5kATo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)