UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QgzmsMohChLYjbNmzXbq3Z2v6UkBejUDQrWoTGYPMb0='
WHERE
key_id = '19f78bd86eb17df3df6cdafb0b53855afc6430a9e15094dd85e378b3c74a7d9c'
AND (
token = 'QgzmsMohChLYjbNmzXbq3Z2v6UkBejUDQrWoTGYPMb0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)